using System.Configuration;

namespace TfsSpam.Differ.Configuration
{
    /// <summary>
    /// The TfsSpamConfig class serves as the root configuration element for the
    /// configuration information required for the TFS Spam functionality to work.
    /// </summary>
    public class TfsSpamConfig : ConfigurationSectionGroup
    {
        #region -- Public properties
        /// <summary>
        /// The settings for how to transform the changeset XML document to
        /// a properly formatted HTML e-mail.
        /// </summary>
        [ConfigurationProperty( "transform", IsRequired = true )]
        public TransformConfig Transform
        {
            get { return (TransformConfig) Sections[ "transform" ]; }
        }

        /// <summary>
        /// The settings for how much information should be included when
        /// files are processed in the changeset XML document.
        /// </summary>
        [ConfigurationProperty( "diff", IsRequired = false )]
        public DiffConfig Diff
        {
            get { return (DiffConfig) Sections[ "diff" ]; }
        }

        /// <summary>
        /// The file types that should have detailed (i.e. diff) information
        /// included in the changeset XML document.
        /// </summary>
        [ConfigurationProperty( "fileTypes", IsRequired = true )]
        public FileTypes FileTypes
        {
            get { return (FileTypes) Sections[ "fileTypes" ]; }
        }

        /// <summary>
        /// The TFS projects that should be processed by TFS Spam and
        /// the information about who the checkin notification e-mails
        /// should be sent to.
        /// </summary>
        [ConfigurationProperty( "teamProjects", IsRequired = true )]
        public TeamProjects TeamProjects
        {
            get { return (TeamProjects) Sections[ "teamProjects" ]; }
        }

        /// <summary>
        /// The list of users whose checkins should be ignored.
        /// </summary>
        [ConfigurationProperty( "ignoreUsers", IsRequired = false )]
        public IgnoreUsers IgnoreUsers
        {
            get { return (IgnoreUsers) Sections[ "ignoreUsers" ]; }
        }

        /// <summary>
        /// The list of highlights from the code that should be summarized
        /// in the highlights section.
        /// </summary>
        [ConfigurationProperty( "highlights", IsRequired = false )]
        public Highlights Highlights
        {
            get { return (Highlights) Sections[ "highlights" ]; }
        }
        #endregion
    }
}
